#include <iostream>
#include "./lib/Eigen/Eigenvalues"
#include "method.h"
#include <fstream>

using namespace Eigen;
using namespace std;

int main() {
    int dim = 50;
    Eigen::EigenSolver<MatrixXd> es;
    MatrixXd A(dim, dim);
    Algebra::Matrix<double> B = Algebra::rand_mat<double>(dim, dim);
    for (int i=0;i<dim;i++) {
	double sum = 0;
	for (int j=0;j<dim;j++) {
	    sum += fabs(B[i][j]);
	    A(i, j) = B[i][j];
	}
	A(i, i) = sum;
    }
    es.compute(A, false);
    fstream fs;
    fs.open("res1", ios::out);
    fs << es.eigenvalues().transpose() << endl;    
    fs.close();
    
    return 0;
}
